package lec09api;

import java.util.Arrays;

public class A {
    public static void main(String[] args) {
        int[] a = new int[]{1, 1, 6, 3, 3,};
        Arrays.sort(a);

        System.out.println(a[0]);
        for (int i = 1; i < a.length; i++) {
            if (a[i] != a[i - 1]) {
                System.out.println(a[i]);
            }
        }


        int[] b = new int[a.length];
        int m = 0;
        b[m++] = a[0];
        for (int i = 1; i < a.length; i++) {
            if (a[i] != a[i - 1]) b[m++] = a[i];
        }
        System.out.println(m);
        for (int i = 0; i < m; i++) {
            System.out.print(b[i] + " ");
        }
    }
}
